package com.example.lifecycle;

import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Example {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext =
                new AnnotationConfigApplicationContext(LifeCycleConfig.class);

        LifeCycleBean lifeCycleBean = applicationContext.getBean(LifeCycleBean.class);
        System.out.println("lifeCycleBean = " + lifeCycleBean);
        applicationContext.close();
    }
}
